<div class="mainbox">
    <div class="pinfo {{infotype}}">
        <img class="logo" bind-src="{{loginer.info.header_url}}?imageView/1/w/120">
        <img-uploader 
            upload-server-url="{{config.other.upload_image}}" 
            text="选择头像图片" 
            bind-input-key="loginer.info.header_url" 
            one-way="true" 
            style="display:inline-block;" 
            max-width="200"
        ></img-uploader>
        <L:input class="focus" placeholder="用户名(不允许更改)" disabled="disabled" value="{{loginer.info.name}}"></L:input>
        <L:input placeholder="昵称" bind-input="{{'loginer.info.nick_name'}}" value="{{loginer.info.nick_name}}"></L:input>
        <L:input class="focus" placeholder="手机" bind-input="{{'loginer.info.mobile_phone'}}" value="{{loginer.info.mobile_phone}}"></L:input>
        <L:input class="focus" placeholder="邮箱" bind-input="{{'loginer.info.email'}}" value="{{loginer.info.email}}"></L:input>
        <L:input placeholder="身份证" bind-input="{{'loginer.info.id_card'}}" value="{{loginer.info.id_card}}"></L:input>
        <L:input placeholder="支付宝账号"  value="{{loginer.info.alipay}}" bind-input="{{'loginer.info.alipay'}}"></L:input>

        <sbutton shadownum1="0 0 10px 1px" shadownum2="0 0 6px 0" text="点击完成修改" class="btn" event-click="{{'$Event.personalinfo.post_edit'}}"></sbutton>
    </div>

    <div class="pinfo">
        <L:input type="password" placeholder="输入当前密码" value="{{$Cache.user.changepwd.current_pwd}}" bind-input="{{'$Cache.user.changepwd.current_pwd'}}"></L:input>
        <L:input type="password" placeholder="输入新密码" bind-input="{{'$Cache.user.changepwd.new_pwd'}}" value="{{$Cache.user.changepwd.new_pwd}}" maxlength="16"></L:input>
        <L:input type="password" placeholder="再次输入新密码" bind-input="{{'$Cache.user.changepwd.new_pwd_bak'}}" value="{{$Cache.user.changepwd.new_pwd_bak}}" maxlength="16"></L:input>
        <sbutton shadownum1="0 0 10px 1px" shadownum2="0 0 6px 0" text="点击完成修改" class="btn" event-click="{{'$Event.user.changepwd.change'}}"></sbutton>
    </div>

    <div class="pinfo">
        <div>{{isremove&&'点击删除地址'||'点击地址可更改默认地址'}}</div>
        {{#each user.address_detail}}
        <div class="addritem {{#if $Top.loginer.default_ua_id===_id}}focus{{/if}} {{$Top.isremove&&' remove'}}" event-click="{{#if $Top.isremove}}{{'$Top.$Event.user.remove_address'}}{{#else}}{{'$Top.$Event.user.set_default_address'}}{{/if}}">
            {{name}}，{{mobilenumber}} {{phonenumber&&("/"+phonenumber)}}，{{province}},{{town}},{{county}}，{{detail}}
        </div>
        {{/each}}
        <sbutton class="btn" shadownum1="0 0 10px 1px" shadownum2="0 0 6px 0" text="{{isnew&&'取消'||'增加地址'}}" event-click="{{'$Event.addaddr'}}"></sbutton>
        <sbutton class="btn" shadownum1="0 0 10px 1px" shadownum2="0 0 6px 0" text="{{isremove&&'取消'||'删除地址'}}" event-click="{{'$Event.removeaddr'}}"></sbutton>
        <div class="newaddr {{isnew&&'focus'}}">
            <select class="province" name="province" event-change={{ '$Event.province'}}>
                <option class="first" value="0">省</option>
                {{#each city_list}}
                <option rel="{{region_id}}" value="{{region_name}}">
                    {{region_name}}
                </option>
                {{/each}}
            </select>

            <select class="city" name="city" disabled event-change={{ '$Event.city'}}>
                <option class="first" value="0">市</option>
            </select>

            <select class="county" name="area" disabled>
                <option class="first" value="0">地区</option>
            </select>
            <L:input name="detailed_addre" placeholder="详细地址"></L:input>
            <L:input name="name" placeholder="收货人"></L:input>
            <L:input name="mobile_num" placeholder="手机"></L:input>
            <sbutton class="btn" shadownum1="0 0 10px 1px" shadownum2="0 0 6px 0" text="确定" event-click="{{'$Event.add_user_address'}}"></sbutton>
        </div>
    </div>
</div>
<script type="text/vm">
	function(vm){
		require(['common'],function(){
			App.set('$Event.addaddr',function(){
				App.model.toggle('isnew');
			});
			App.set('$Event.removeaddr',function(){
				App.model.toggle('isremove');
			});
		})
	}
</script>
